﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tools.Viewers.MeshViewer.Properties;

namespace Tools.Viewers.MeshViewer
{
    public partial class FormInfoControls : Form
    {

        private Image[] iconsKeyboard = 
        {
            Resources.keyboard_up,
            Resources.keyboard_down,
            Resources.keyboard_left,
            Resources.keyboard_right,
            Resources.keyboard_shiftup,
            Resources.keyboard_shiftdown,
            Resources.keyboard_shiftleft,
            Resources.keyboard_shiftright,
        };
        private Image[] iconsMouse = 
        {
            Resources.mouseleft_down,
            Resources.mouseleft_up,
            Resources.mouseleft_right,
            Resources.mouseleft_left,
            Resources.mousescroll_up,
            Resources.mousescroll_down,
            Resources.mouseright_cw,
            Resources.mouseright_ccw,
        };
        private string[] descriptions = 
        {
            "Description: \n\rWith a spherical movement around the mesh, pans the camera to the up.",
            "Description: \n\rWith a spherical movement around the mesh, pans the camera to the down.",
            "Description: \n\rWith a spherical movement around the mesh, pans the camera to the left.",
            "Description: \n\rWith a spherical movement around the mesh, pans the camera to the right.",
            "Description: \n\rWith a directional movement to the mesh, zooms the camera in.",
            "Description: \n\rWith a directional movement to the mesh, zooms the camera out.",
            "Description: \n\rWith a circular movement related to the mesh, rotate the camera clockwise.",
            "Description: \n\rWith a circular movement related to the mesh, rotate the camera counter-clockwise.",
        };
        public FormInfoControls()
        {
            InitializeComponent();
            comboBoxControls.SelectedIndex = 0;
        }

        private void buttonPrev_Click(object sender, EventArgs e)
        {
            if (comboBoxControls.SelectedIndex > 0)
            {
                comboBoxControls.SelectedIndex--;
            }
        }

        private void buttonNext_Click(object sender, EventArgs e)
        {
            if (comboBoxControls.SelectedIndex < comboBoxControls.Items.Count - 1)
            {
                comboBoxControls.SelectedIndex++;
            }
        }

        private void comboBoxControls_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBoxDescription.Text = descriptions[comboBoxControls.SelectedIndex];
            pictureKeyboard.Image = iconsKeyboard[comboBoxControls.SelectedIndex];
            pictureMouse.Image = iconsMouse[comboBoxControls.SelectedIndex]; 
            RefreshButtons();
        }

        private void RefreshButtons()
        {
            buttonPrev.Enabled = (comboBoxControls.SelectedIndex > 0);
            buttonNext.Enabled = (comboBoxControls.SelectedIndex < comboBoxControls.Items.Count - 1);
        }

    }
}
